package c.c.a;

import java.util.Iterator;
import org.json.JSONException;
import org.json.JSONObject;

public class n0 {
    public static String a;

    /* JADX WARNING: Removed duplicated region for block: B:34:0x008b  */
    /* JADX WARNING: Removed duplicated region for block: B:28:0x0081 A:{SYNTHETIC, Splitter:B:28:0x0081} */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x008b  */
    public static java.lang.String a(android.content.Context r5) {
        /*
        r0 = a;
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 != 0) goto L_0x0009;
    L_0x0008:
        return r0;
    L_0x0009:
        r0 = android.os.Process.myPid();	 Catch:{ Exception -> 0x0032 }
        r1 = "activity";
        r5 = r5.getSystemService(r1);	 Catch:{ Exception -> 0x0032 }
        r5 = (android.app.ActivityManager) r5;	 Catch:{ Exception -> 0x0032 }
        r5 = r5.getRunningAppProcesses();	 Catch:{ Exception -> 0x0032 }
        r5 = r5.iterator();	 Catch:{ Exception -> 0x0032 }
    L_0x001d:
        r1 = r5.hasNext();	 Catch:{ Exception -> 0x0032 }
        if (r1 == 0) goto L_0x0036;
    L_0x0023:
        r1 = r5.next();	 Catch:{ Exception -> 0x0032 }
        r1 = (android.app.ActivityManager.RunningAppProcessInfo) r1;	 Catch:{ Exception -> 0x0032 }
        r2 = r1.pid;	 Catch:{ Exception -> 0x0032 }
        if (r2 != r0) goto L_0x001d;
    L_0x002d:
        r5 = r1.processName;	 Catch:{ Exception -> 0x0032 }
        a = r5;	 Catch:{ Exception -> 0x0032 }
        goto L_0x0036;
    L_0x0032:
        r5 = move-exception;
        r5.printStackTrace();
    L_0x0036:
        r5 = 0;
        r0 = new java.io.BufferedReader;	 Catch:{ all -> 0x007e }
        r1 = new java.io.InputStreamReader;	 Catch:{ all -> 0x007e }
        r2 = new java.io.FileInputStream;	 Catch:{ all -> 0x007e }
        r3 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007e }
        r3.<init>();	 Catch:{ all -> 0x007e }
        r4 = "/proc/";
        r3.append(r4);	 Catch:{ all -> 0x007e }
        r4 = android.os.Process.myPid();	 Catch:{ all -> 0x007e }
        r3.append(r4);	 Catch:{ all -> 0x007e }
        r4 = "/cmdline";
        r3.append(r4);	 Catch:{ all -> 0x007e }
        r3 = r3.toString();	 Catch:{ all -> 0x007e }
        r2.<init>(r3);	 Catch:{ all -> 0x007e }
        r3 = "iso-8859-1";
        r1.<init>(r2, r3);	 Catch:{ all -> 0x007e }
        r0.<init>(r1);	 Catch:{ all -> 0x007e }
        r1 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007c }
        r1.<init>();	 Catch:{ all -> 0x007c }
    L_0x0067:
        r2 = r0.read();	 Catch:{ all -> 0x007c }
        if (r2 <= 0) goto L_0x0072;
    L_0x006d:
        r2 = (char) r2;	 Catch:{ all -> 0x007c }
        r1.append(r2);	 Catch:{ all -> 0x007c }
        goto L_0x0067;
    L_0x0072:
        r1 = r1.toString();	 Catch:{ all -> 0x007c }
        r0.close();	 Catch:{ Exception -> 0x007a }
        goto L_0x0085;
        goto L_0x0085;
        goto L_0x007f;
    L_0x007e:
        r0 = r5;
    L_0x007f:
        if (r0 == 0) goto L_0x0084;
    L_0x0081:
        r0.close();	 Catch:{ Exception -> 0x0084 }
    L_0x0084:
        r1 = r5;
    L_0x0085:
        a = r1;
        r0 = c.c.a.m0.b;
        if (r0 == 0) goto L_0x009d;
    L_0x008b:
        r0 = "getProcessName, ";
        r0 = c.b.a.a.a.g(r0);
        r1 = a;
        r0.append(r1);
        r0 = r0.toString();
        c.c.a.m0.a(r0, r5);
    L_0x009d:
        r5 = a;
        return r5;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.a.n0.a(android.content.Context):java.lang.String");
    }

    public static String b(boolean z) {
        return z ? "yes" : "no";
    }

    public static boolean c(JSONObject jSONObject, JSONObject jSONObject2) {
        if (jSONObject != null && jSONObject2 != null) {
            return jSONObject.toString().equals(jSONObject2.toString());
        }
        boolean z = jSONObject == jSONObject2 || (jSONObject != null && jSONObject.equals(jSONObject2));
        return z;
    }

    public static JSONObject d(JSONObject jSONObject, JSONObject jSONObject2) {
        try {
            Iterator keys = jSONObject2.keys();
            while (keys.hasNext()) {
                String str = (String) keys.next();
                jSONObject.put(str, jSONObject2.opt(str));
            }
        } catch (JSONException e) {
            m0.b(e);
        }
        return jSONObject;
    }
}
